Hi, |
Re: Doors date to Unix timestamp
This code fragment loops through the columns of the current view and shows which displayed attributes are of type Date. For those attributes and the current object, the UNIX timestamp is calculated and printed.
Module currMod = current Module
Object obj
Column col
string colAttName
string colTitle
Date thisDate
int thisUnixTimestamp
AttrDef ad
if (!null currMod)
{ // Current Module is not null
obj = current Object
for col in currMod do
{ // Loop through columns in current view
colTitle = title(col)
colAttName = attrName(col)
if (!null colAttName)
{ // Column displays attribute
ad = find(current Module, colAttName)
if (ad.typeName == "Date")
{ // Attribute of type date
print "Column '" colTitle "' displays '" colAttName "' of type Date\n"
if (!null obj)
{ // Current object is not null
thisDate = obj.colAttName
thisUnixTimestamp = intOf thisDate
print "The current value is " thisDate " [" thisUnixTimestamp "]\n"
} // Current object is not null
} // Attribute of type date
} // Column displays attribute
} // Loop through columns in current view
} // Current Module is not null
|